Socket
Socket
Sign inDemoInstall

archive-type

Package Overview
Dependencies
Maintainers
2
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

archive-type

Detect the archive type of a Buffer/Uint8Array


Version published
Weekly downloads
2M
decreased by-6.12%
Maintainers
2
Weekly downloads
 
Created

What is archive-type?

The archive-type npm package is used to detect the type of archive file based on its buffer. It supports various archive formats such as zip, tar, rar, and more.

What are archive-type's main functionalities?

Detect Archive Type

This feature allows you to detect the type of an archive file by reading its buffer. The code sample reads a file into a buffer and then uses the archiveType function to determine the file type.

const archiveType = require('archive-type');
const fs = require('fs');

const buffer = fs.readFileSync('example.zip');
const type = archiveType(buffer);
console.log(type); // { ext: 'zip', mime: 'application/zip' }

Other packages similar to archive-type

Keywords

FAQs

Package last updated on 25 Apr 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc